
<div class="cuerpo-blog">
    <h2>BLOG / <a style="color: #59C5D1;">Bepoket Print</a></h2>

    <?php global $query_string; ?>
    <?php query_posts($query_string . "&posts_per_page=2"); ?>
    <?php wp_pagenavi(); ?>
    <div class="menu-blog">
        <ul id="R-1">
            <li class="R-1"><a>Mantenete Informado</a>
                <ul id="R-2"><li class="R-2"><a href="<?php bloginfo('rss2_url'); ?>">-RSS Feed</a></li></ul>
            </li>
            <li class="R-1"><a>Seguinos</a>
                <ul id="R-2">

                    <?php $links = get_bookmarks('category_name=Redes Sociales'); ?>
                    <?php foreach ($links as $link) {?>
                    <li class="R-2"><a href="<?php echo $link->link_url;?>" target="_blank">-<?php echo $link->link_name;?></a></li>
                    <?php } ?>
                </ul>
            </li>
            <li class="R-1"><a href="<?php echo get_category_link(get_cat_ID('blog')); ?>">Categorías</a>
                <ul id="R-2">

                    <?php
                    $categories = get_categories(array('child_of' => get_cat_ID('blog'), 'hide_empty' => 0));
//        echo '<pre>';
//        print_r($categories);
//        echo '</pre>';
                    foreach ($categories as $categoria) {
                        ?>
                        <li class="R-2<?php if (is_category($categoria->slug)) echo ' activo'; ?>"><a href="<?php echo get_category_link($categoria->term_id); ?>"><?php echo '-' . $categoria->name . ' (' . $categoria->count . ')'; ?></a></li>

                    <?php } ?>
                </ul>
            </li>
        </ul>
    </div>

    <div class="posts">
        <?php if (have_posts()) { ?>
            <?php while (have_posts()) : the_post(); ?>

                <div class="post">
                    <div class="imagen-post">

                        <?php edit_post_link(__(''), '<span class="editar-caja">', '</span>', $id); ?>
                        <?php
                        if (get_the_post_thumbnail()) {
                            $image_id = get_post_thumbnail_id();
                            $image_attributes = wp_get_attachment_image_src($image_id, 'medium');
                            ?>
                            <img src="<?php echo $image_attributes[0]; ?>" width="100%">
                        <?php } else { ?>
                            <img src="<?php bloginfo('template_url') ?>/images/no-imagen.jpg" style="width: 100%;">
                        <?php } ?>
                    </div>
                    <div class="resumen-post">
                        <h3><?php the_title(); ?></h3>
                        <p><?php the_content(); ?></p>
                    </div>
                </div>

            <?php endwhile; ?>
            <?php
        } else {
            echo 'No hay post en esta categoría..';
        }
        ?>

    </div>
    <?php wp_pagenavi(); ?>
</div>